<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>

    <!--MyHeader-->
    <div th:include="common::MyHeader"></div>
    <!-- End of MyHeader -->
    <link rel="stylesheet" th:href="@{/ztree/3.5/css/default/zTreeStyle.css}">
    <link th:href="@{/ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>

</head>

<body id="page-top">

<!-- Page Wrapper -->
<div id="wrapper">

    <!-- Sidebar -->
    <ul th:replace="common::Sidebar(${session.user.loginName},${session.role.roleName})"></ul>
    <!-- End of Sidebar -->

    <!-- Content Wrapper -->
    <div id="content-wrapper" class="d-flex flex-column">

        <!-- Main Content -->
        <div id="content">

            <!-- Topbar -->
            <div th:include="common::Topbar(${session.user.userName})"></div>
            <!-- End of Topbar -->

            <!-- Begin Page Content -->
            <div class="container-fluid">

                <!-- Page Heading -->
                <div class="d-sm-flex align-items-center justify-content-between mb-4">
                    <h1 class="h3 mb-0 text-gray-800">发布·公告通知</h1>
                </div>

                <div>
                    <div class="my-2"></div>
                    <div data-toggle="modal" data-target="#teacherNotice" shiro:hasRole="admin">
                        <a href="#" class="btn btn-primary btn-icon-split" onclick="TTreeShow()">
                    <span class="icon text-white-50">
                      <i class="fas fa-arrow-right"></i>
                    </span>
                            <span class="text">To 教师·通知公告</span>
                        </a>
                    </div>

                    <div class="my-2"></div>
                    <div data-toggle="modal" data-target="#studentNotice">
                        <a href="#" class="btn btn-success btn-icon-split" onclick="STreeShow()">
                    <span class="icon text-white-50">
                      <i class="fas fa-arrow-right"></i>
                    </span>
                            <span class="text">To 学生·通知公告</span>
                        </a>
                    </div>
                </div>

            </div>
            <!-- /.container-fluid -->

        </div>
        <!-- End of Main Content -->

        <!-- Footer -->
        <div th:include="common::Footer"></div>
        <!-- End of Footer -->

    </div>
    <!-- End of Content Wrapper -->

</div>
<!-- End of Page Wrapper -->

<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
    <i class="fas fa-angle-up"></i>
</a>

<!-- Logout Modal-->
<div th:include="common::LogoutModal"></div>
<script th:src="@{/ztree/3.5/js/jquery.ztree.core-3.5.js}"></script>
<script th:src="@{/ztree/3.5/js/jquery.ztree.excheck-3.5.js}"></script>
<script th:src="@{/js/notice_create.js}"></script>


<!-- StudentModal -->
<div class="modal fade" id="studentNotice" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog"
     aria-labelledby="studentNoticeLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="studentNoticeLabel">To 学生</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="form-row">
                    <div class="form-group col-lg-6">
                        <label for="Stitle">标题</label>
                        <input type="text" class="form-control" id="Stitle">
                    </div>
                </div>

                <div class="form-group">
                    <label for="SMyContent">内容</label>
                    <textarea class="form-control" id="SMyContent" rows="3"></textarea>
                </div>

                <div class="form-group">
                    <label>开放的学院</label>
                    <div class="row">
                        <div class="col-md-12">
                            <div id="Stree" class="ztree"></div>
                        </div>
                    </div>
                </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary" id="SReviewAndConfirm" onclick="SConfirm()">确定</button>
            </div>
        </div>
    </div>
</div>


<!-- STeacherModal -->
<div class="modal fade" id="teacherNotice" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog"
     aria-labelledby="teacherNoticeLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="teacherNoticeLabel">To 教师</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="form-row">
                    <div class="form-group col-lg-6">
                        <label for="Ttitle">标题</label>
                        <input type="text" class="form-control" id="Ttitle">
                    </div>
                </div>

                <div class="form-group">
                    <label for="TMyContent">内容</label>
                    <textarea class="form-control" id="TMyContent" rows="3"></textarea>
                </div>

                <div class="form-group">
                    <label>开放的学院</label>
                    <div class="row">
                        <div class="col-md-12">
                            <div id="Ttree" class="ztree"></div>
                        </div>
                    </div>
                </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary" id="TReviewAndConfirm" onclick="TConfirm()">确定</button>
            </div>
        </div>
    </div>
</div>
</body>

</html>
